{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "using VMLS\n",
    "using LinearAlgebra"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Chapter 11\n",
    "# Matrix inverses\n",
    "### 11.1 Left and right inverses\n",
    "We’ll see later how to find a left or right inverse, when one exists."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×2 Array{Int64,2}:\n",
       " -3  -4\n",
       "  4   6\n",
       "  1   1"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = [-3 -4; 4 6; 1 1]\n",
    "B = [-11 -10 16; 7 8 -11]/9 # A left inverse of A\n",
    "C = [0 -1 6; 0 1 -4]/2 # Another left inverse of A;\n",
    "A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2×3 Array{Float64,2}:\n",
       " -1.22222   -1.11111    1.77778\n",
       "  0.777778   0.888889  -1.22222"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2×3 Array{Float64,2}:\n",
       " 0.0  -0.5   3.0\n",
       " 0.0   0.5  -2.0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "C"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "([1.0 0.0; -4.44089e-16 1.0], [1.0 0.0; 0.0 1.0])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Let’s check\n",
    "B*A, C*A"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 11.2 Inverse\n",
    "\n",
    "If `A` is invertible, its inverse is given by `inv(A)` (and also `A^-1`). You’ll get an error if `A` is not invertible, or not square."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×3 Array{Float64,2}:\n",
       " 1.0  0.0          0.0        \n",
       " 0.0  1.0          2.77556e-17\n",
       " 0.0  5.55112e-17  1.0        "
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = [1 -2 3; 0 2 2; -4 -4 -4]\n",
    "B = inv(A)\n",
    "B*A"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×3 Array{Float64,2}:\n",
       "  1.0           1.11022e-16  0.0        \n",
       "  5.55112e-17   1.0          1.38778e-17\n",
       " -1.11022e-16  -2.22045e-16  1.0        "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A*B"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Dual basis.** The next example illustrates the dual basis provided by the rows of the inverse $B = A^{−1}$. We calculate the expansion $x = (b^T_1 x)a_1 + · · ·+ (b^T_nx)a_n$ for a $3 × 3$ example (see page [205](https://web.stanford.edu/~boyd/vmls/vmls.pdf#section*.249) of VMLS)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×3 Array{Int64,2}:\n",
       " 1   0   1\n",
       " 4  -3  -4\n",
       " 1  -1  -2"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = [ 1 0 1; 4 -3 -4; 1 -1 -2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×3 Array{Float64,2}:\n",
       "  2.0  -1.0   3.0\n",
       "  4.0  -3.0   8.0\n",
       " -1.0   1.0  -3.0"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "B = inv(A)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3-element Array{Float64,1}:\n",
       "  0.2\n",
       " -0.3\n",
       "  1.2"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = [ 0.2, -0.3, 1.2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3-element Array{Float64,1}:\n",
       "  0.20000000000000018\n",
       " -0.3000000000000007 \n",
       "  1.1999999999999984 "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rhs = (B[1,:]'*x) * A[:,1] + (B[2,:]'*x) * A[:,2] + (B[3,:]'*x) * A[:,3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Inverse via QR factorization.** The inverse of a matrix $A$ can be computed from\n",
    "its $QR$ factorization $A = QR$ via the formula $A^{−1} = R^{−1}Q^T$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×3 Array{Float64,2}:\n",
       "  2.66916    -3.22492   -0.182156 \n",
       "  0.0733047  -0.421658  -0.40232  \n",
       " -0.131794   -0.538957   0.0756908"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = randn(3,3);\n",
    "inv(A)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×3 Array{Float64,2}:\n",
       "  2.66916    -3.22492   -0.182156 \n",
       "  0.0733047  -0.421658  -0.40232  \n",
       " -0.131794   -0.538957   0.0756908"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Q, R = qr(A);\n",
    "Q = Matrix(Q);\n",
    "inv(R)*Q'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×3 Array{Float64,2}:\n",
       " 0.0  0.0  0.0\n",
       " 0.0  0.0  0.0\n",
       " 0.0  0.0  0.0"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "diff = inv(A) .- inv(R)*Q'\n",
    "[abs(round(x)) for x in diff]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 11.3 Solving linear equations\n",
    "**Back substitution.** Let’s first implement back substitution (VMLS Algorithm [11.1](https://web.stanford.edu/~boyd/vmls/vmls.pdf#algorithmctr.11.1)) in Julia, and check it. You won’t need this function, since Julia has a better implementation of it built in (via the backslash operation discussed below). We give it here only to demonstrate that it works."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "back_subst (generic function with 1 method)"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "function back_subst(R,b)\n",
    "n = length(b)\n",
    "x = zeros(n)\n",
    "for i=n:-1:1\n",
    "x[i] = (b[i] - R[i,i+1:n]'*x[i+1:n]) / R[i,i]\n",
    "end\n",
    "return x\n",
    "end"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4×4 Array{Float64,2}:\n",
       " 0.412766  0.537275   0.178279   0.758884\n",
       " 0.0       1.13957   -0.387773   1.03998 \n",
       " 0.0       0.0        0.282488   0.383023\n",
       " 0.0       0.0        0.0       -0.323032"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "R = triu(randn(4,4)) # Random 4x4 upper triangular matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.220446049250313e-16"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b = rand(4);\n",
    "x = back_subst(R,b);\n",
    "norm(R*x-b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The function `triu` gives the upper triangular part of a matrix, i.e., it zeros out the entries below the diagonal. \n",
    "\n",
    "**Backslash notation.** The Julia command for solving a set of linear equations $$Ax = b$$ is `x=A\\b`. This is faster than `x=inv(A)*b`, which first computes the inverse of $A$ and then multiplies it with $b$."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  1.895570 seconds (2.40 M allocations: 305.018 MiB, 8.42% gc time)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2.526931950837245e-10"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n = 5000;\n",
    "A = randn(n,n); b = randn(n); # random set of equations\n",
    "@time x1 = A\\b;\n",
    "norm(b-A*x1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  4.041957 seconds (14 allocations: 193.253 MiB, 1.89% gc time)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "7.245777255862661e-10"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "@time x2 = inv(A)*b;\n",
    "norm(b-A*x2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Julia chooses a suitable algorithm for solving the equation after checking the\n",
    "properties of $A$. For example, it will use back substitution if $A$ is lower triangular.\n",
    "This explains the result in the following timing experiment."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  0.026764 seconds (6 allocations: 39.297 KiB)\n",
      "  0.948335 seconds (11 allocations: 190.812 MiB, 7.81% gc time)\n",
      "  0.118969 seconds (6 allocations: 78.359 KiB)\n",
      "  5.935020 seconds (11 allocations: 763.092 MiB, 1.41% gc time)\n"
     ]
    }
   ],
   "source": [
    "n = 5000;\n",
    "b = randn(n);\n",
    "A = tril(randn(n,n)); # random lower triangular matrix\n",
    "@time x = A\\b;\n",
    "A = randn(n,n); # random square matrix\n",
    "@time x = A\\b;\n",
    "n = 10000;\n",
    "b = randn(n);\n",
    "A = tril(randn(n,n)); # random lower triangular matrix\n",
    "@time x = A\\b;\n",
    "A = randn(n,n); # random square matrix\n",
    "@time x = A\\b;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "When we double the size from $n = 5000$ to $n = 10000$, the solution time for the\n",
    "triangular equation increases from $0.04$ seconds to $1.29$ seconds. This is a factor of\n",
    "about four, consistent with the $n^2$ complexity of backsubstitution. For the general\n",
    "square system, the solution times increases from $0.16$ seconds to $9.01$ seconds, i.e.,\n",
    "a factor of roughly eight, as we would expect given the order $n^3$ complexity.\n",
    "Factor-solve methods for multiple right-hand sides. A linear equation is solved\n",
    "by first factorizing $A$ and then solving several simpler equations with the factors\n",
    "of $A$. This is referred to as a factor-solve scheme. An important application is the\n",
    "solution of multiple linear equations with the same coefficient matrix and different\n",
    "right-hand sides."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "  1.174692 seconds (55.51 k allocations: 193.487 MiB, 6.27% gc time)\n",
      "  0.868358 seconds (14 allocations: 190.850 MiB, 1.92% gc time)\n",
      "  1.860890 seconds (236.75 k allocations: 393.211 MiB, 4.57% gc time)\n",
      "  1.007361 seconds (341.62 k allocations: 207.593 MiB, 2.03% gc time)\n"
     ]
    }
   ],
   "source": [
    "n = 5000;\n",
    "A = randn(n,n); B = randn(n,2);\n",
    "# Solve with right-hand side B[:,1]\n",
    "@time x1 = A \\ B[:,1];\n",
    "# Solve with right-hand side B[:,2]\n",
    "@time x2 = A \\ B[:,2];\n",
    "# Naive approach for solving A*X = B\n",
    "@time X = [ A\\B[:,1] A\\B[:,2] ];\n",
    "# Factor-solve approach\n",
    "@time X = A \\ B;"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The factor-solve approach finds the solutions for the two right-hand sides in roughly\n",
    "the same time as the solution for one right-hand side. The solution time with the\n",
    "naïve approach is twice the time for one right-hand side.\n",
    "\n",
    "### 11.4 Examples\n",
    "**Polynomial interpolation.** We compute the interpolating polynomials in Figure [11.1](https://web.stanford.edu/~boyd/vmls/vmls.pdf#figure.11.1) of VMLS. The following code uses the functions vandermonde and linspace from the `VMLS` package. (Th function `linspace(a,b,n)` returns a vector with `n` equally spaced numbers in the interval [a, b].) The result is shown in Figure 11.1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4×4 Array{Float64,2}:\n",
       " 1.0  -1.1  1.21  -1.331\n",
       " 1.0  -0.4  0.16  -0.064\n",
       " 1.0   0.2  0.04   0.008\n",
       " 1.0   0.8  0.64   0.512"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "t = [ -1.1, -0.4, 0.2, 0.8 ];\n",
    "A = vandermonde(t, 4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4-element Array{Float64,1}:\n",
       "  1.2109568793779317\n",
       " -0.8883105198894669\n",
       " -1.1096651886125566\n",
       "  1.3864790180579647"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b1 = [ -1.0, 1.3, 1.0, 0.5 ];\n",
    "c1 = A \\ b1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4-element Array{Float64,1}:\n",
       " -1.5412891202364887\n",
       " -3.1090546880020584\n",
       "  3.3384743911059704\n",
       "  3.695135274082644 "
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b2 = [ 1.0, 0.0, -2.0, 0 ];\n",
    "c2 = A \\ b2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n",
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"600\" height=\"400\" viewBox=\"0 0 2400 1600\">\n",
       "<defs>\n",
       "  <clipPath id=\"clip9300\">\n",
       "    <rect x=\"0\" y=\"0\" width=\"2400\" height=\"1600\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<path clip-path=\"url(#clip9300)\" d=\"\n",
       "M0 1600 L2400 1600 L2400 0 L0 0  Z\n",
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<defs>\n",
       "  <clipPath id=\"clip9301\">\n",
       "    <rect x=\"480\" y=\"0\" width=\"1681\" height=\"1600\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<path clip-path=\"url(#clip9300)\" d=\"\n",
       "M141.865 1487.47 L2352.76 1487.47 L2352.76 47.2441 L141.865 47.2441  Z\n",
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<defs>\n",
       "  <clipPath id=\"clip9302\">\n",
       "    <rect x=\"141\" y=\"47\" width=\"2212\" height=\"1441\"/>\n",
       "  </clipPath>\n",
       "</defs>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  378.249,1487.47 378.249,47.2441 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  812.78,1487.47 812.78,47.2441 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1247.31,1487.47 1247.31,47.2441 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  1681.84,1487.47 1681.84,47.2441 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  2116.37,1487.47 2116.37,47.2441 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  141.865,1434.1 2352.76,1434.1 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  141.865,1094.2 2352.76,1094.2 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  141.865,754.293 2352.76,754.293 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  141.865,414.389 2352.76,414.389 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none\" points=\"\n",
       "  141.865,74.4843 2352.76,74.4843 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  141.865,1487.47 2352.76,1487.47 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  141.865,1487.47 141.865,47.2441 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  378.249,1487.47 378.249,1465.87 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  812.78,1487.47 812.78,1465.87 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1247.31,1487.47 1247.31,1465.87 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1681.84,1487.47 1681.84,1465.87 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  2116.37,1487.47 2116.37,1465.87 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  141.865,1434.1 175.028,1434.1 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  141.865,1094.2 175.028,1094.2 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  141.865,754.293 175.028,754.293 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  141.865,414.389 175.028,414.389 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  141.865,74.4843 175.028,74.4843 \n",
       "  \"/>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 378.249, 1541.47)\" x=\"378.249\" y=\"1541.47\">-1.0</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 812.78, 1541.47)\" x=\"812.78\" y=\"1541.47\">-0.5</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1247.31, 1541.47)\" x=\"1247.31\" y=\"1541.47\">0.0</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 1681.84, 1541.47)\" x=\"1681.84\" y=\"1541.47\">0.5</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:middle;\" transform=\"rotate(0, 2116.37, 1541.47)\" x=\"2116.37\" y=\"1541.47\">1.0</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 117.865, 1451.6)\" x=\"117.865\" y=\"1451.6\">-2</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 117.865, 1111.7)\" x=\"117.865\" y=\"1111.7\">0</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 117.865, 771.793)\" x=\"117.865\" y=\"771.793\">2</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 117.865, 431.889)\" x=\"117.865\" y=\"431.889\">4</text>\n",
       "</g>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:end;\" transform=\"rotate(0, 117.865, 91.9843)\" x=\"117.865\" y=\"91.9843\">6</text>\n",
       "</g>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  204.437,1385.98 206.525,1382.81 208.613,1379.66 210.7,1376.52 212.788,1373.39 214.876,1370.27 216.964,1367.17 219.052,1364.08 221.14,1360.99 223.227,1357.93 \n",
       "  225.315,1354.87 227.403,1351.82 229.491,1348.79 231.579,1345.77 233.667,1342.76 235.754,1339.76 237.842,1336.77 239.93,1333.8 242.018,1330.83 244.106,1327.88 \n",
       "  246.194,1324.94 248.281,1322.01 250.369,1319.09 252.457,1316.19 254.545,1313.29 256.633,1310.41 258.721,1307.54 260.808,1304.68 262.896,1301.83 264.984,1298.99 \n",
       "  267.072,1296.17 269.16,1293.35 271.248,1290.55 273.335,1287.76 275.423,1284.98 277.511,1282.21 279.599,1279.45 281.687,1276.71 283.775,1273.97 285.862,1271.25 \n",
       "  287.95,1268.53 290.038,1265.83 292.126,1263.14 294.214,1260.46 296.302,1257.79 298.389,1255.14 300.477,1252.49 302.565,1249.86 304.653,1247.23 306.741,1244.62 \n",
       "  308.829,1242.02 310.917,1239.43 313.004,1236.85 315.092,1234.28 317.18,1231.72 319.268,1229.17 321.356,1226.64 323.444,1224.11 325.531,1221.6 327.619,1219.09 \n",
       "  329.707,1216.6 331.795,1214.12 333.883,1211.65 335.971,1209.19 338.058,1206.74 340.146,1204.3 342.234,1201.87 344.322,1199.45 346.41,1197.05 348.498,1194.65 \n",
       "  350.585,1192.26 352.673,1189.89 354.761,1187.53 356.849,1185.17 358.937,1182.83 361.025,1180.5 363.112,1178.17 365.2,1175.86 367.288,1173.56 369.376,1171.27 \n",
       "  371.464,1168.99 373.552,1166.72 375.639,1164.46 377.727,1162.21 379.815,1159.97 381.903,1157.74 383.991,1155.52 386.079,1153.31 388.166,1151.12 390.254,1148.93 \n",
       "  392.342,1146.75 394.43,1144.58 396.518,1142.43 398.606,1140.28 400.693,1138.14 402.781,1136.02 404.869,1133.9 406.957,1131.79 409.045,1129.7 411.133,1127.61 \n",
       "  413.22,1125.53 415.308,1123.47 417.396,1121.41 419.484,1119.36 421.572,1117.33 423.66,1115.3 425.747,1113.28 427.835,1111.28 429.923,1109.28 432.011,1107.29 \n",
       "  434.099,1105.32 436.187,1103.35 438.274,1101.39 440.362,1099.44 442.45,1097.51 444.538,1095.58 446.626,1093.66 448.714,1091.75 450.801,1089.85 452.889,1087.96 \n",
       "  454.977,1086.08 457.065,1084.21 459.153,1082.35 461.241,1080.5 463.328,1078.66 465.416,1076.83 467.504,1075 469.592,1073.19 471.68,1071.39 473.768,1069.59 \n",
       "  475.855,1067.81 477.943,1066.03 480.031,1064.27 482.119,1062.51 484.207,1060.76 486.295,1059.03 488.382,1057.3 490.47,1055.58 492.558,1053.87 494.646,1052.17 \n",
       "  496.734,1050.48 498.822,1048.8 500.909,1047.12 502.997,1045.46 505.085,1043.8 507.173,1042.16 509.261,1040.52 511.349,1038.9 513.436,1037.28 515.524,1035.67 \n",
       "  517.612,1034.07 519.7,1032.48 521.788,1030.9 523.876,1029.32 525.963,1027.76 528.051,1026.2 530.139,1024.66 532.227,1023.12 534.315,1021.59 536.403,1020.07 \n",
       "  538.49,1018.56 540.578,1017.06 542.666,1015.57 544.754,1014.08 546.842,1012.61 548.93,1011.14 551.017,1009.68 553.105,1008.24 555.193,1006.8 557.281,1005.36 \n",
       "  559.369,1003.94 561.457,1002.53 563.544,1001.12 565.632,999.723 567.72,998.334 569.808,996.954 571.896,995.582 573.984,994.219 576.071,992.865 578.159,991.519 \n",
       "  580.247,990.181 582.335,988.852 584.423,987.531 586.511,986.219 588.598,984.915 590.686,983.619 592.774,982.332 594.862,981.053 596.95,979.782 599.038,978.52 \n",
       "  601.125,977.266 603.213,976.02 605.301,974.783 607.389,973.553 609.477,972.332 611.565,971.119 613.652,969.914 615.74,968.717 617.828,967.528 619.916,966.348 \n",
       "  622.004,965.175 624.092,964.011 626.179,962.854 628.267,961.706 630.355,960.566 632.443,959.433 634.531,958.309 636.619,957.192 638.707,956.083 640.794,954.982 \n",
       "  642.882,953.889 644.97,952.804 647.058,951.727 649.146,950.658 651.234,949.596 653.321,948.542 655.409,947.496 657.497,946.458 659.585,945.427 661.673,944.404 \n",
       "  663.761,943.389 665.848,942.381 667.936,941.381 670.024,940.389 672.112,939.404 674.2,938.427 676.288,937.457 678.375,936.495 680.463,935.54 682.551,934.593 \n",
       "  684.639,933.654 686.727,932.722 688.815,931.797 690.902,930.88 692.99,929.97 695.078,929.067 697.166,928.172 699.254,927.284 701.342,926.404 703.429,925.531 \n",
       "  705.517,924.665 707.605,923.806 709.693,922.955 711.781,922.11 713.869,921.274 715.956,920.444 718.044,919.621 720.132,918.806 722.22,917.997 724.308,917.196 \n",
       "  726.396,916.402 728.483,915.615 730.571,914.835 732.659,914.062 734.747,913.296 736.835,912.537 738.923,911.785 741.01,911.04 743.098,910.302 745.186,909.57 \n",
       "  747.274,908.846 749.362,908.129 751.45,907.418 753.537,906.714 755.625,906.017 757.713,905.327 759.801,904.644 761.889,903.967 763.977,903.297 766.064,902.634 \n",
       "  768.152,901.977 770.24,901.328 772.328,900.684 774.416,900.048 776.504,899.418 778.591,898.795 780.679,898.178 782.767,897.568 784.855,896.964 786.943,896.367 \n",
       "  789.031,895.776 791.118,895.192 793.206,894.614 795.294,894.043 797.382,893.478 799.47,892.92 801.558,892.368 803.645,891.822 805.733,891.283 807.821,890.75 \n",
       "  809.909,890.223 811.997,889.703 814.085,889.189 816.172,888.681 818.26,888.179 820.348,887.683 822.436,887.194 824.524,886.711 826.612,886.234 828.699,885.763 \n",
       "  830.787,885.298 832.875,884.84 834.963,884.387 837.051,883.941 839.139,883.5 841.226,883.066 843.314,882.637 845.402,882.214 847.49,881.798 849.578,881.387 \n",
       "  851.666,880.982 853.753,880.584 855.841,880.191 857.929,879.803 860.017,879.422 862.105,879.047 864.193,878.677 866.28,878.313 868.368,877.955 870.456,877.602 \n",
       "  872.544,877.256 874.632,876.915 876.72,876.579 878.807,876.25 880.895,875.925 882.983,875.607 885.071,875.294 887.159,874.987 889.247,874.685 891.334,874.389 \n",
       "  893.422,874.098 895.51,873.813 897.598,873.534 899.686,873.259 901.774,872.991 903.861,872.727 905.949,872.469 908.037,872.217 910.125,871.97 912.213,871.728 \n",
       "  914.301,871.491 916.388,871.26 918.476,871.034 920.564,870.813 922.652,870.598 924.74,870.388 926.828,870.183 928.915,869.983 931.003,869.788 933.091,869.599 \n",
       "  935.179,869.414 937.267,869.235 939.355,869.061 941.442,868.892 943.53,868.728 945.618,868.569 947.706,868.415 949.794,868.265 951.882,868.121 953.969,867.982 \n",
       "  956.057,867.848 958.145,867.719 960.233,867.594 962.321,867.475 964.409,867.36 966.497,867.25 968.584,867.145 970.672,867.045 972.76,866.95 974.848,866.859 \n",
       "  976.936,866.773 979.024,866.692 981.111,866.615 983.199,866.543 985.287,866.476 987.375,866.414 989.463,866.356 991.551,866.302 993.638,866.254 995.726,866.209 \n",
       "  997.814,866.17 999.902,866.135 1001.99,866.104 1004.08,866.078 1006.17,866.056 1008.25,866.039 1010.34,866.026 1012.43,866.017 1014.52,866.013 1016.6,866.014 \n",
       "  1018.69,866.018 1020.78,866.027 1022.87,866.04 1024.96,866.058 1027.04,866.08 1029.13,866.106 1031.22,866.136 1033.31,866.171 1035.4,866.209 1037.48,866.252 \n",
       "  1039.57,866.299 1041.66,866.35 1043.75,866.405 1045.83,866.465 1047.92,866.528 1050.01,866.596 1052.1,866.667 1054.19,866.742 1056.27,866.822 1058.36,866.905 \n",
       "  1060.45,866.993 1062.54,867.084 1064.62,867.179 1066.71,867.278 1068.8,867.381 1070.89,867.488 1072.98,867.599 1075.06,867.713 1077.15,867.832 1079.24,867.954 \n",
       "  1081.33,868.079 1083.42,868.209 1085.5,868.342 1087.59,868.479 1089.68,868.62 1091.77,868.764 1093.85,868.912 1095.94,869.064 1098.03,869.219 1100.12,869.377 \n",
       "  1102.21,869.54 1104.29,869.706 1106.38,869.875 1108.47,870.048 1110.56,870.224 1112.64,870.404 1114.73,870.587 1116.82,870.774 1118.91,870.964 1121,871.157 \n",
       "  1123.08,871.354 1125.17,871.554 1127.26,871.758 1129.35,871.964 1131.44,872.174 1133.52,872.388 1135.61,872.604 1137.7,872.824 1139.79,873.047 1141.87,873.273 \n",
       "  1143.96,873.502 1146.05,873.735 1148.14,873.971 1150.23,874.209 1152.31,874.451 1154.4,874.696 1156.49,874.944 1158.58,875.195 1160.67,875.449 1162.75,875.706 \n",
       "  1164.84,875.966 1166.93,876.229 1169.02,876.494 1171.1,876.763 1173.19,877.035 1175.28,877.309 1177.37,877.587 1179.46,877.867 1181.54,878.15 1183.63,878.436 \n",
       "  1185.72,878.724 1187.81,879.015 1189.89,879.31 1191.98,879.606 1194.07,879.906 1196.16,880.208 1198.25,880.513 1200.33,880.82 1202.42,881.13 1204.51,881.443 \n",
       "  1206.6,881.758 1208.69,882.076 1210.77,882.396 1212.86,882.719 1214.95,883.044 1217.04,883.372 1219.12,883.703 1221.21,884.035 1223.3,884.37 1225.39,884.708 \n",
       "  1227.48,885.048 1229.56,885.39 1231.65,885.735 1233.74,886.082 1235.83,886.431 1237.91,886.783 1240,887.137 1242.09,887.493 1244.18,887.851 1246.27,888.211 \n",
       "  1248.35,888.574 1250.44,888.939 1252.53,889.306 1254.62,889.675 1256.71,890.046 1258.79,890.42 1260.88,890.795 1262.97,891.172 1265.06,891.552 1267.14,891.933 \n",
       "  1269.23,892.317 1271.32,892.702 1273.41,893.09 1275.5,893.479 1277.58,893.87 1279.67,894.263 1281.76,894.659 1283.85,895.055 1285.94,895.454 1288.02,895.855 \n",
       "  1290.11,896.257 1292.2,896.661 1294.29,897.067 1296.37,897.474 1298.46,897.884 1300.55,898.295 1302.64,898.707 1304.73,899.122 1306.81,899.538 1308.9,899.955 \n",
       "  1310.99,900.374 1313.08,900.795 1315.16,901.217 1317.25,901.641 1319.34,902.067 1321.43,902.494 1323.52,902.922 1325.6,903.352 1327.69,903.783 1329.78,904.216 \n",
       "  1331.87,904.65 1333.96,905.085 1336.04,905.522 1338.13,905.96 1340.22,906.4 1342.31,906.841 1344.39,907.283 1346.48,907.726 1348.57,908.171 1350.66,908.616 \n",
       "  1352.75,909.063 1354.83,909.512 1356.92,909.961 1359.01,910.412 1361.1,910.863 1363.19,911.316 1365.27,911.77 1367.36,912.225 1369.45,912.681 1371.54,913.138 \n",
       "  1373.62,913.596 1375.71,914.055 1377.8,914.515 1379.89,914.976 1381.98,915.438 1384.06,915.9 1386.15,916.364 1388.24,916.829 1390.33,917.294 1392.41,917.76 \n",
       "  1394.5,918.227 1396.59,918.695 1398.68,919.164 1400.77,919.633 1402.85,920.103 1404.94,920.574 1407.03,921.046 1409.12,921.518 1411.21,921.991 1413.29,922.464 \n",
       "  1415.38,922.938 1417.47,923.413 1419.56,923.888 1421.64,924.364 1423.73,924.84 1425.82,925.317 1427.91,925.795 1430,926.273 1432.08,926.751 1434.17,927.23 \n",
       "  1436.26,927.709 1438.35,928.189 1440.43,928.669 1442.52,929.149 1444.61,929.63 1446.7,930.111 1448.79,930.592 1450.87,931.074 1452.96,931.556 1455.05,932.038 \n",
       "  1457.14,932.52 1459.23,933.003 1461.31,933.485 1463.4,933.968 1465.49,934.451 1467.58,934.935 1469.66,935.418 1471.75,935.901 1473.84,936.385 1475.93,936.868 \n",
       "  1478.02,937.352 1480.1,937.835 1482.19,938.319 1484.28,938.803 1486.37,939.286 1488.46,939.769 1490.54,940.253 1492.63,940.736 1494.72,941.219 1496.81,941.702 \n",
       "  1498.89,942.185 1500.98,942.667 1503.07,943.15 1505.16,943.632 1507.25,944.114 1509.33,944.595 1511.42,945.077 1513.51,945.558 1515.6,946.039 1517.68,946.519 \n",
       "  1519.77,946.999 1521.86,947.479 1523.95,947.958 1526.04,948.437 1528.12,948.915 1530.21,949.393 1532.3,949.871 1534.39,950.348 1536.48,950.824 1538.56,951.3 \n",
       "  1540.65,951.775 1542.74,952.25 1544.83,952.724 1546.91,953.198 1549,953.671 1551.09,954.143 1553.18,954.615 1555.27,955.085 1557.35,955.556 1559.44,956.025 \n",
       "  1561.53,956.494 1563.62,956.962 1565.7,957.429 1567.79,957.895 1569.88,958.361 1571.97,958.825 1574.06,959.289 1576.14,959.752 1578.23,960.214 1580.32,960.675 \n",
       "  1582.41,961.135 1584.5,961.594 1586.58,962.052 1588.67,962.509 1590.76,962.965 1592.85,963.42 1594.93,963.874 1597.02,964.327 1599.11,964.779 1601.2,965.23 \n",
       "  1603.29,965.679 1605.37,966.127 1607.46,966.575 1609.55,967.021 1611.64,967.465 1613.73,967.909 1615.81,968.351 1617.9,968.792 1619.99,969.231 1622.08,969.67 \n",
       "  1624.16,970.107 1626.25,970.542 1628.34,970.977 1630.43,971.409 1632.52,971.841 1634.6,972.271 1636.69,972.699 1638.78,973.126 1640.87,973.552 1642.95,973.976 \n",
       "  1645.04,974.398 1647.13,974.819 1649.22,975.238 1651.31,975.656 1653.39,976.072 1655.48,976.487 1657.57,976.9 1659.66,977.311 1661.75,977.72 1663.83,978.128 \n",
       "  1665.92,978.534 1668.01,978.938 1670.1,979.341 1672.18,979.741 1674.27,980.14 1676.36,980.537 1678.45,980.933 1680.54,981.326 1682.62,981.717 1684.71,982.107 \n",
       "  1686.8,982.494 1688.89,982.88 1690.98,983.264 1693.06,983.645 1695.15,984.025 1697.24,984.403 1699.33,984.778 1701.41,985.152 1703.5,985.523 1705.59,985.893 \n",
       "  1707.68,986.26 1709.77,986.625 1711.85,986.988 1713.94,987.348 1716.03,987.707 1718.12,988.063 1720.2,988.417 1722.29,988.769 1724.38,989.119 1726.47,989.466 \n",
       "  1728.56,989.811 1730.64,990.153 1732.73,990.493 1734.82,990.831 1736.91,991.167 1739,991.5 1741.08,991.83 1743.17,992.158 1745.26,992.484 1747.35,992.807 \n",
       "  1749.43,993.127 1751.52,993.445 1753.61,993.761 1755.7,994.074 1757.79,994.384 1759.87,994.692 1761.96,994.997 1764.05,995.299 1766.14,995.599 1768.22,995.896 \n",
       "  1770.31,996.19 1772.4,996.482 1774.49,996.771 1776.58,997.057 1778.66,997.34 1780.75,997.62 1782.84,997.898 1784.93,998.173 1787.02,998.445 1789.1,998.714 \n",
       "  1791.19,998.98 1793.28,999.243 1795.37,999.503 1797.45,999.761 1799.54,1000.01 1801.63,1000.27 1803.72,1000.51 1805.81,1000.76 1807.89,1001 1809.98,1001.24 \n",
       "  1812.07,1001.48 1814.16,1001.71 1816.25,1001.94 1818.33,1002.17 1820.42,1002.39 1822.51,1002.61 1824.6,1002.83 1826.68,1003.04 1828.77,1003.25 1830.86,1003.46 \n",
       "  1832.95,1003.66 1835.04,1003.86 1837.12,1004.06 1839.21,1004.25 1841.3,1004.44 1843.39,1004.63 1845.47,1004.81 1847.56,1004.99 1849.65,1005.17 1851.74,1005.34 \n",
       "  1853.83,1005.51 1855.91,1005.68 1858,1005.84 1860.09,1006 1862.18,1006.16 1864.27,1006.31 1866.35,1006.46 1868.44,1006.6 1870.53,1006.74 1872.62,1006.88 \n",
       "  1874.7,1007.01 1876.79,1007.14 1878.88,1007.27 1880.97,1007.39 1883.06,1007.51 1885.14,1007.62 1887.23,1007.74 1889.32,1007.84 1891.41,1007.95 1893.49,1008.05 \n",
       "  1895.58,1008.14 1897.67,1008.23 1899.76,1008.32 1901.85,1008.4 1903.93,1008.48 1906.02,1008.56 1908.11,1008.63 1910.2,1008.7 1912.29,1008.76 1914.37,1008.82 \n",
       "  1916.46,1008.88 1918.55,1008.93 1920.64,1008.98 1922.72,1009.02 1924.81,1009.06 1926.9,1009.09 1928.99,1009.13 1931.08,1009.15 1933.16,1009.17 1935.25,1009.19 \n",
       "  1937.34,1009.21 1939.43,1009.22 1941.52,1009.22 1943.6,1009.22 1945.69,1009.22 1947.78,1009.21 1949.87,1009.2 1951.95,1009.18 1954.04,1009.16 1956.13,1009.13 \n",
       "  1958.22,1009.1 1960.31,1009.07 1962.39,1009.03 1964.48,1008.98 1966.57,1008.94 1968.66,1008.88 1970.74,1008.83 1972.83,1008.76 1974.92,1008.7 1977.01,1008.63 \n",
       "  1979.1,1008.55 1981.18,1008.47 1983.27,1008.38 1985.36,1008.29 1987.45,1008.2 1989.54,1008.1 1991.62,1007.99 1993.71,1007.88 1995.8,1007.77 1997.89,1007.65 \n",
       "  1999.97,1007.53 2002.06,1007.4 2004.15,1007.26 2006.24,1007.13 2008.33,1006.98 2010.41,1006.83 2012.5,1006.68 2014.59,1006.52 2016.68,1006.36 2018.77,1006.19 \n",
       "  2020.85,1006.02 2022.94,1005.84 2025.03,1005.65 2027.12,1005.46 2029.2,1005.27 2031.29,1005.07 2033.38,1004.87 2035.47,1004.66 2037.56,1004.44 2039.64,1004.22 \n",
       "  2041.73,1004 2043.82,1003.77 2045.91,1003.53 2047.99,1003.29 2050.08,1003.04 2052.17,1002.79 2054.26,1002.53 2056.35,1002.27 2058.43,1002 2060.52,1001.73 \n",
       "  2062.61,1001.45 2064.7,1001.16 2066.79,1000.87 2068.87,1000.58 2070.96,1000.28 2073.05,999.97 2075.14,999.657 2077.22,999.339 2079.31,999.016 2081.4,998.687 \n",
       "  2083.49,998.352 2085.58,998.012 2087.66,997.665 2089.75,997.313 2091.84,996.956 2093.93,996.592 2096.01,996.223 2098.1,995.848 2100.19,995.468 2102.28,995.081 \n",
       "  2104.37,994.689 2106.45,994.29 2108.54,993.886 2110.63,993.476 2112.72,993.06 2114.81,992.638 2116.89,992.21 2118.98,991.776 2121.07,991.336 2123.16,990.89 \n",
       "  2125.24,990.438 2127.33,989.98 2129.42,989.516 2131.51,989.046 2133.6,988.569 2135.68,988.087 2137.77,987.598 2139.86,987.103 2141.95,986.602 2144.04,986.095 \n",
       "  2146.12,985.581 2148.21,985.061 2150.3,984.535 2152.39,984.003 2154.47,983.464 2156.56,982.919 2158.65,982.368 2160.74,981.81 2162.83,981.246 2164.91,980.675 \n",
       "  2167,980.098 2169.09,979.514 2171.18,978.924 2173.26,978.328 2175.35,977.725 2177.44,977.115 2179.53,976.499 2181.62,975.877 2183.7,975.247 2185.79,974.611 \n",
       "  2187.88,973.969 2189.97,973.32 2192.06,972.664 2194.14,972.001 2196.23,971.332 2198.32,970.656 2200.41,969.973 2202.49,969.284 2204.58,968.587 2206.67,967.884 \n",
       "  2208.76,967.174 2210.85,966.457 2212.93,965.734 2215.02,965.003 2217.11,964.266 2219.2,963.521 2221.28,962.77 2223.37,962.012 2225.46,961.246 2227.55,960.474 \n",
       "  2229.64,959.695 2231.72,958.908 2233.81,958.115 2235.9,957.314 2237.99,956.507 2240.08,955.692 2242.16,954.87 2244.25,954.041 2246.34,953.205 2248.43,952.361 \n",
       "  2250.51,951.51 2252.6,950.653 2254.69,949.787 2256.78,948.915 2258.87,948.035 2260.95,947.148 2263.04,946.254 2265.13,945.352 2267.22,944.443 2269.31,943.526 \n",
       "  2271.39,942.602 2273.48,941.671 2275.57,940.732 2277.66,939.785 2279.74,938.831 2281.83,937.87 2283.92,936.901 2286.01,935.925 2288.1,934.941 2290.18,933.949 \n",
       "  \n",
       "  \"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"291.343\" cy=\"1264.15\" r=\"18\"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#e26f46; stroke:none; fill-opacity:1\" cx=\"291.343\" cy=\"1264.15\" r=\"14\"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"899.686\" cy=\"873.259\" r=\"18\"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#e26f46; stroke:none; fill-opacity:1\" cx=\"899.686\" cy=\"873.259\" r=\"14\"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"1421.12\" cy=\"924.245\" r=\"18\"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#e26f46; stroke:none; fill-opacity:1\" cx=\"1421.12\" cy=\"924.245\" r=\"14\"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"1942.56\" cy=\"1009.22\" r=\"18\"/>\n",
       "<circle clip-path=\"url(#clip9302)\" style=\"fill:#e26f46; stroke:none; fill-opacity:1\" cx=\"1942.56\" cy=\"1009.22\" r=\"14\"/>\n",
       "<polyline clip-path=\"url(#clip9302)\" style=\"stroke:#3da44d; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  204.437,990.223 206.525,988.256 208.613,986.308 210.7,984.38 212.788,982.472 214.876,980.582 216.964,978.712 219.052,976.861 221.14,975.03 223.227,973.217 \n",
       "  225.315,971.424 227.403,969.649 229.491,967.894 231.579,966.157 233.667,964.44 235.754,962.741 237.842,961.061 239.93,959.399 242.018,957.756 244.106,956.132 \n",
       "  246.194,954.527 248.281,952.94 250.369,951.371 252.457,949.821 254.545,948.289 256.633,946.776 258.721,945.28 260.808,943.803 262.896,942.344 264.984,940.903 \n",
       "  267.072,939.48 269.16,938.075 271.248,936.688 273.335,935.319 275.423,933.968 277.511,932.634 279.599,931.319 281.687,930.021 283.775,928.74 285.862,927.477 \n",
       "  287.95,926.232 290.038,925.004 292.126,923.793 294.214,922.6 296.302,921.424 298.389,920.265 300.477,919.124 302.565,917.999 304.653,916.892 306.741,915.802 \n",
       "  308.829,914.729 310.917,913.673 313.004,912.633 315.092,911.611 317.18,910.605 319.268,909.616 321.356,908.643 323.444,907.688 325.531,906.748 327.619,905.826 \n",
       "  329.707,904.919 331.795,904.03 333.883,903.156 335.971,902.299 338.058,901.458 340.146,900.633 342.234,899.825 344.322,899.032 346.41,898.256 348.498,897.496 \n",
       "  350.585,896.751 352.673,896.023 354.761,895.31 356.849,894.613 358.937,893.932 361.025,893.266 363.112,892.616 365.2,891.982 367.288,891.363 369.376,890.76 \n",
       "  371.464,890.172 373.552,889.6 375.639,889.042 377.727,888.5 379.815,887.974 381.903,887.462 383.991,886.966 386.079,886.484 388.166,886.018 390.254,885.566 \n",
       "  392.342,885.13 394.43,884.708 396.518,884.301 398.606,883.909 400.693,883.531 402.781,883.169 404.869,882.82 406.957,882.486 409.045,882.167 411.133,881.862 \n",
       "  413.22,881.572 415.308,881.296 417.396,881.034 419.484,880.786 421.572,880.553 423.66,880.333 425.747,880.128 427.835,879.937 429.923,879.759 432.011,879.596 \n",
       "  434.099,879.446 436.187,879.31 438.274,879.188 440.362,879.08 442.45,878.985 444.538,878.904 446.626,878.837 448.714,878.783 450.801,878.742 452.889,878.715 \n",
       "  454.977,878.701 457.065,878.7 459.153,878.712 461.241,878.738 463.328,878.777 465.416,878.829 467.504,878.894 469.592,878.972 471.68,879.063 473.768,879.166 \n",
       "  475.855,879.283 477.943,879.412 480.031,879.554 482.119,879.709 484.207,879.876 486.295,880.055 488.382,880.248 490.47,880.452 492.558,880.669 494.646,880.899 \n",
       "  496.734,881.14 498.822,881.394 500.909,881.66 502.997,881.939 505.085,882.229 507.173,882.531 509.261,882.846 511.349,883.172 513.436,883.51 515.524,883.86 \n",
       "  517.612,884.221 519.7,884.595 521.788,884.98 523.876,885.376 525.963,885.785 528.051,886.204 530.139,886.635 532.227,887.078 534.315,887.532 536.403,887.997 \n",
       "  538.49,888.473 540.578,888.961 542.666,889.46 544.754,889.97 546.842,890.49 548.93,891.022 551.017,891.565 553.105,892.119 555.193,892.683 557.281,893.258 \n",
       "  559.369,893.844 561.457,894.441 563.544,895.048 565.632,895.666 567.72,896.294 569.808,896.933 571.896,897.582 573.984,898.241 576.071,898.911 578.159,899.591 \n",
       "  580.247,900.282 582.335,900.982 584.423,901.692 586.511,902.413 588.598,903.143 590.686,903.884 592.774,904.634 594.862,905.394 596.95,906.164 599.038,906.944 \n",
       "  601.125,907.733 603.213,908.532 605.301,909.341 607.389,910.159 609.477,910.986 611.565,911.823 613.652,912.669 615.74,913.525 617.828,914.39 619.916,915.264 \n",
       "  622.004,916.147 624.092,917.039 626.179,917.94 628.267,918.851 630.355,919.77 632.443,920.698 634.531,921.635 636.619,922.581 638.707,923.535 640.794,924.498 \n",
       "  642.882,925.47 644.97,926.451 647.058,927.44 649.146,928.437 651.234,929.443 653.321,930.457 655.409,931.479 657.497,932.51 659.585,933.549 661.673,934.596 \n",
       "  663.761,935.651 665.848,936.715 667.936,937.786 670.024,938.865 672.112,939.952 674.2,941.047 676.288,942.15 678.375,943.26 680.463,944.379 682.551,945.504 \n",
       "  684.639,946.638 686.727,947.779 688.815,948.927 690.902,950.083 692.99,951.246 695.078,952.417 697.166,953.594 699.254,954.779 701.342,955.972 703.429,957.171 \n",
       "  705.517,958.377 707.605,959.591 709.693,960.811 711.781,962.038 713.869,963.272 715.956,964.513 718.044,965.761 720.132,967.015 722.22,968.276 724.308,969.543 \n",
       "  726.396,970.817 728.483,972.098 730.571,973.385 732.659,974.678 734.747,975.978 736.835,977.284 738.923,978.596 741.01,979.915 743.098,981.239 745.186,982.57 \n",
       "  747.274,983.906 749.362,985.249 751.45,986.597 753.537,987.952 755.625,989.312 757.713,990.678 759.801,992.049 761.889,993.426 763.977,994.809 766.064,996.198 \n",
       "  768.152,997.591 770.24,998.991 772.328,1000.4 774.416,1001.81 776.504,1003.22 778.591,1004.64 780.679,1006.07 782.767,1007.5 784.855,1008.93 786.943,1010.37 \n",
       "  789.031,1011.82 791.118,1013.27 793.206,1014.73 795.294,1016.19 797.382,1017.65 799.47,1019.12 801.558,1020.6 803.645,1022.08 805.733,1023.56 807.821,1025.05 \n",
       "  809.909,1026.54 811.997,1028.04 814.085,1029.54 816.172,1031.05 818.26,1032.56 820.348,1034.07 822.436,1035.59 824.524,1037.11 826.612,1038.64 828.699,1040.17 \n",
       "  830.787,1041.7 832.875,1043.24 834.963,1044.78 837.051,1046.33 839.139,1047.88 841.226,1049.43 843.314,1050.99 845.402,1052.55 847.49,1054.11 849.578,1055.68 \n",
       "  851.666,1057.25 853.753,1058.82 855.841,1060.4 857.929,1061.98 860.017,1063.57 862.105,1065.15 864.193,1066.74 866.28,1068.34 868.368,1069.93 870.456,1071.53 \n",
       "  872.544,1073.13 874.632,1074.74 876.72,1076.35 878.807,1077.96 880.895,1079.57 882.983,1081.18 885.071,1082.8 887.159,1084.42 889.247,1086.05 891.334,1087.67 \n",
       "  893.422,1089.3 895.51,1090.93 897.598,1092.56 899.686,1094.2 901.774,1095.83 903.861,1097.47 905.949,1099.11 908.037,1100.76 910.125,1102.4 912.213,1104.05 \n",
       "  914.301,1105.7 916.388,1107.35 918.476,1109 920.564,1110.65 922.652,1112.31 924.74,1113.97 926.828,1115.62 928.915,1117.28 931.003,1118.94 933.091,1120.61 \n",
       "  935.179,1122.27 937.267,1123.94 939.355,1125.6 941.442,1127.27 943.53,1128.94 945.618,1130.61 947.706,1132.28 949.794,1133.95 951.882,1135.63 953.969,1137.3 \n",
       "  956.057,1138.97 958.145,1140.65 960.233,1142.32 962.321,1144 964.409,1145.68 966.497,1147.35 968.584,1149.03 970.672,1150.71 972.76,1152.39 974.848,1154.07 \n",
       "  976.936,1155.75 979.024,1157.43 981.111,1159.11 983.199,1160.79 985.287,1162.47 987.375,1164.15 989.463,1165.83 991.551,1167.51 993.638,1169.19 995.726,1170.87 \n",
       "  997.814,1172.54 999.902,1174.22 1001.99,1175.9 1004.08,1177.58 1006.17,1179.26 1008.25,1180.93 1010.34,1182.61 1012.43,1184.29 1014.52,1185.96 1016.6,1187.64 \n",
       "  1018.69,1189.31 1020.78,1190.98 1022.87,1192.66 1024.96,1194.33 1027.04,1196 1029.13,1197.67 1031.22,1199.33 1033.31,1201 1035.4,1202.67 1037.48,1204.33 \n",
       "  1039.57,1205.99 1041.66,1207.66 1043.75,1209.32 1045.83,1210.98 1047.92,1212.63 1050.01,1214.29 1052.1,1215.94 1054.19,1217.6 1056.27,1219.25 1058.36,1220.9 \n",
       "  1060.45,1222.54 1062.54,1224.19 1064.62,1225.83 1066.71,1227.47 1068.8,1229.11 1070.89,1230.75 1072.98,1232.38 1075.06,1234.02 1077.15,1235.65 1079.24,1237.28 \n",
       "  1081.33,1238.9 1083.42,1240.53 1085.5,1242.15 1087.59,1243.77 1089.68,1245.38 1091.77,1247 1093.85,1248.61 1095.94,1250.22 1098.03,1251.82 1100.12,1253.42 \n",
       "  1102.21,1255.02 1104.29,1256.62 1106.38,1258.22 1108.47,1259.81 1110.56,1261.39 1112.64,1262.98 1114.73,1264.56 1116.82,1266.14 1118.91,1267.71 1121,1269.29 \n",
       "  1123.08,1270.85 1125.17,1272.42 1127.26,1273.98 1129.35,1275.54 1131.44,1277.09 1133.52,1278.64 1135.61,1280.19 1137.7,1281.73 1139.79,1283.27 1141.87,1284.81 \n",
       "  1143.96,1286.34 1146.05,1287.87 1148.14,1289.39 1150.23,1290.91 1152.31,1292.43 1154.4,1293.94 1156.49,1295.44 1158.58,1296.95 1160.67,1298.44 1162.75,1299.94 \n",
       "  1164.84,1301.43 1166.93,1302.91 1169.02,1304.39 1171.1,1305.87 1173.19,1307.34 1175.28,1308.81 1177.37,1310.27 1179.46,1311.73 1181.54,1313.18 1183.63,1314.63 \n",
       "  1185.72,1316.07 1187.81,1317.51 1189.89,1318.94 1191.98,1320.37 1194.07,1321.79 1196.16,1323.2 1198.25,1324.62 1200.33,1326.02 1202.42,1327.42 1204.51,1328.82 \n",
       "  1206.6,1330.21 1208.69,1331.59 1210.77,1332.97 1212.86,1334.34 1214.95,1335.71 1217.04,1337.07 1219.12,1338.43 1221.21,1339.78 1223.3,1341.12 1225.39,1342.46 \n",
       "  1227.48,1343.8 1229.56,1345.12 1231.65,1346.44 1233.74,1347.76 1235.83,1349.06 1237.91,1350.36 1240,1351.66 1242.09,1352.95 1244.18,1354.23 1246.27,1355.51 \n",
       "  1248.35,1356.78 1250.44,1358.04 1252.53,1359.3 1254.62,1360.54 1256.71,1361.79 1258.79,1363.02 1260.88,1364.25 1262.97,1365.48 1265.06,1366.69 1267.14,1367.9 \n",
       "  1269.23,1369.1 1271.32,1370.29 1273.41,1371.48 1275.5,1372.66 1277.58,1373.83 1279.67,1375 1281.76,1376.16 1283.85,1377.31 1285.94,1378.45 1288.02,1379.59 \n",
       "  1290.11,1380.71 1292.2,1381.83 1294.29,1382.95 1296.37,1384.05 1298.46,1385.15 1300.55,1386.24 1302.64,1387.32 1304.73,1388.39 1306.81,1389.46 1308.9,1390.52 \n",
       "  1310.99,1391.57 1313.08,1392.61 1315.16,1393.64 1317.25,1394.67 1319.34,1395.68 1321.43,1396.69 1323.52,1397.69 1325.6,1398.68 1327.69,1399.66 1329.78,1400.64 \n",
       "  1331.87,1401.6 1333.96,1402.56 1336.04,1403.51 1338.13,1404.45 1340.22,1405.38 1342.31,1406.3 1344.39,1407.21 1346.48,1408.12 1348.57,1409.01 1350.66,1409.9 \n",
       "  1352.75,1410.77 1354.83,1411.64 1356.92,1412.5 1359.01,1413.35 1361.1,1414.19 1363.19,1415.02 1365.27,1415.84 1367.36,1416.65 1369.45,1417.45 1371.54,1418.24 \n",
       "  1373.62,1419.03 1375.71,1419.8 1377.8,1420.56 1379.89,1421.32 1381.98,1422.06 1384.06,1422.79 1386.15,1423.52 1388.24,1424.23 1390.33,1424.93 1392.41,1425.63 \n",
       "  1394.5,1426.31 1396.59,1426.98 1398.68,1427.64 1400.77,1428.3 1402.85,1428.94 1404.94,1429.57 1407.03,1430.19 1409.12,1430.8 1411.21,1431.4 1413.29,1431.99 \n",
       "  1415.38,1432.57 1417.47,1433.13 1419.56,1433.69 1421.64,1434.24 1423.73,1434.77 1425.82,1435.3 1427.91,1435.81 1430,1436.31 1432.08,1436.8 1434.17,1437.28 \n",
       "  1436.26,1437.75 1438.35,1438.21 1440.43,1438.65 1442.52,1439.09 1444.61,1439.51 1446.7,1439.92 1448.79,1440.32 1450.87,1440.71 1452.96,1441.09 1455.05,1441.45 \n",
       "  1457.14,1441.8 1459.23,1442.15 1461.31,1442.48 1463.4,1442.79 1465.49,1443.1 1467.58,1443.39 1469.66,1443.67 1471.75,1443.94 1473.84,1444.2 1475.93,1444.45 \n",
       "  1478.02,1444.68 1480.1,1444.9 1482.19,1445.11 1484.28,1445.3 1486.37,1445.49 1488.46,1445.66 1490.54,1445.82 1492.63,1445.96 1494.72,1446.09 1496.81,1446.21 \n",
       "  1498.89,1446.32 1500.98,1446.42 1503.07,1446.5 1505.16,1446.57 1507.25,1446.62 1509.33,1446.66 1511.42,1446.69 1513.51,1446.71 1515.6,1446.71 1517.68,1446.7 \n",
       "  1519.77,1446.68 1521.86,1446.64 1523.95,1446.59 1526.04,1446.53 1528.12,1446.45 1530.21,1446.36 1532.3,1446.26 1534.39,1446.14 1536.48,1446.01 1538.56,1445.86 \n",
       "  1540.65,1445.7 1542.74,1445.53 1544.83,1445.34 1546.91,1445.14 1549,1444.92 1551.09,1444.69 1553.18,1444.45 1555.27,1444.19 1557.35,1443.92 1559.44,1443.63 \n",
       "  1561.53,1443.33 1563.62,1443.02 1565.7,1442.69 1567.79,1442.34 1569.88,1441.99 1571.97,1441.61 1574.06,1441.22 1576.14,1440.82 1578.23,1440.4 1580.32,1439.97 \n",
       "  1582.41,1439.52 1584.5,1439.06 1586.58,1438.59 1588.67,1438.09 1590.76,1437.59 1592.85,1437.06 1594.93,1436.53 1597.02,1435.97 1599.11,1435.41 1601.2,1434.82 \n",
       "  1603.29,1434.22 1605.37,1433.61 1607.46,1432.98 1609.55,1432.33 1611.64,1431.67 1613.73,1431 1615.81,1430.3 1617.9,1429.59 1619.99,1428.87 1622.08,1428.13 \n",
       "  1624.16,1427.37 1626.25,1426.6 1628.34,1425.81 1630.43,1425.01 1632.52,1424.19 1634.6,1423.35 1636.69,1422.5 1638.78,1421.63 1640.87,1420.75 1642.95,1419.85 \n",
       "  1645.04,1418.93 1647.13,1417.99 1649.22,1417.04 1651.31,1416.08 1653.39,1415.09 1655.48,1414.09 1657.57,1413.07 1659.66,1412.04 1661.75,1410.99 1663.83,1409.92 \n",
       "  1665.92,1408.83 1668.01,1407.73 1670.1,1406.61 1672.18,1405.47 1674.27,1404.32 1676.36,1403.15 1678.45,1401.96 1680.54,1400.76 1682.62,1399.53 1684.71,1398.29 \n",
       "  1686.8,1397.03 1688.89,1395.76 1690.98,1394.47 1693.06,1393.15 1695.15,1391.83 1697.24,1390.48 1699.33,1389.12 1701.41,1387.73 1703.5,1386.33 1705.59,1384.92 \n",
       "  1707.68,1383.48 1709.77,1382.03 1711.85,1380.55 1713.94,1379.06 1716.03,1377.56 1718.12,1376.03 1720.2,1374.48 1722.29,1372.92 1724.38,1371.34 1726.47,1369.74 \n",
       "  1728.56,1368.12 1730.64,1366.48 1732.73,1364.83 1734.82,1363.15 1736.91,1361.46 1739,1359.75 1741.08,1358.02 1743.17,1356.27 1745.26,1354.5 1747.35,1352.71 \n",
       "  1749.43,1350.9 1751.52,1349.07 1753.61,1347.23 1755.7,1345.36 1757.79,1343.48 1759.87,1341.58 1761.96,1339.66 1764.05,1337.71 1766.14,1335.75 1768.22,1333.77 \n",
       "  1770.31,1331.77 1772.4,1329.75 1774.49,1327.71 1776.58,1325.65 1778.66,1323.57 1780.75,1321.47 1782.84,1319.35 1784.93,1317.21 1787.02,1315.05 1789.1,1312.88 \n",
       "  1791.19,1310.68 1793.28,1308.46 1795.37,1306.22 1797.45,1303.96 1799.54,1301.68 1801.63,1299.38 1803.72,1297.05 1805.81,1294.71 1807.89,1292.35 1809.98,1289.97 \n",
       "  1812.07,1287.57 1814.16,1285.14 1816.25,1282.7 1818.33,1280.23 1820.42,1277.75 1822.51,1275.24 1824.6,1272.71 1826.68,1270.16 1828.77,1267.59 1830.86,1265 \n",
       "  1832.95,1262.39 1835.04,1259.75 1837.12,1257.1 1839.21,1254.42 1841.3,1251.72 1843.39,1249.01 1845.47,1246.27 1847.56,1243.5 1849.65,1240.72 1851.74,1237.91 \n",
       "  1853.83,1235.09 1855.91,1232.24 1858,1229.37 1860.09,1226.48 1862.18,1223.56 1864.27,1220.63 1866.35,1217.67 1868.44,1214.69 1870.53,1211.69 1872.62,1208.66 \n",
       "  1874.7,1205.62 1876.79,1202.55 1878.88,1199.46 1880.97,1196.34 1883.06,1193.21 1885.14,1190.05 1887.23,1186.87 1889.32,1183.67 1891.41,1180.44 1893.49,1177.19 \n",
       "  1895.58,1173.92 1897.67,1170.63 1899.76,1167.31 1901.85,1163.97 1903.93,1160.61 1906.02,1157.22 1908.11,1153.81 1910.2,1150.38 1912.29,1146.93 1914.37,1143.45 \n",
       "  1916.46,1139.95 1918.55,1136.42 1920.64,1132.87 1922.72,1129.3 1924.81,1125.71 1926.9,1122.09 1928.99,1118.45 1931.08,1114.78 1933.16,1111.09 1935.25,1107.38 \n",
       "  1937.34,1103.64 1939.43,1099.88 1941.52,1096.1 1943.6,1092.29 1945.69,1088.46 1947.78,1084.6 1949.87,1080.72 1951.95,1076.82 1954.04,1072.89 1956.13,1068.94 \n",
       "  1958.22,1064.96 1960.31,1060.96 1962.39,1056.93 1964.48,1052.88 1966.57,1048.81 1968.66,1044.71 1970.74,1040.58 1972.83,1036.43 1974.92,1032.26 1977.01,1028.06 \n",
       "  1979.1,1023.84 1981.18,1019.59 1983.27,1015.32 1985.36,1011.02 1987.45,1006.7 1989.54,1002.35 1991.62,997.979 1993.71,993.581 1995.8,989.157 1997.89,984.709 \n",
       "  1999.97,980.235 2002.06,975.736 2004.15,971.211 2006.24,966.661 2008.33,962.085 2010.41,957.484 2012.5,952.857 2014.59,948.205 2016.68,943.526 2018.77,938.822 \n",
       "  2020.85,934.092 2022.94,929.336 2025.03,924.554 2027.12,919.746 2029.2,914.912 2031.29,910.052 2033.38,905.166 2035.47,900.254 2037.56,895.315 2039.64,890.35 \n",
       "  2041.73,885.358 2043.82,880.341 2045.91,875.296 2047.99,870.225 2050.08,865.128 2052.17,860.004 2054.26,854.853 2056.35,849.675 2058.43,844.471 2060.52,839.24 \n",
       "  2062.61,833.982 2064.7,828.697 2066.79,823.385 2068.87,818.046 2070.96,812.68 2073.05,807.286 2075.14,801.866 2077.22,796.418 2079.31,790.943 2081.4,785.44 \n",
       "  2083.49,779.91 2085.58,774.353 2087.66,768.768 2089.75,763.155 2091.84,757.515 2093.93,751.847 2096.01,746.152 2098.1,740.429 2100.19,734.677 2102.28,728.898 \n",
       "  2104.37,723.091 2106.45,717.256 2108.54,711.393 2110.63,705.502 2112.72,699.583 2114.81,693.635 2116.89,687.659 2118.98,681.655 2121.07,675.623 2123.16,669.562 \n",
       "  2125.24,663.473 2127.33,657.355 2129.42,651.208 2131.51,645.033 2133.6,638.83 2135.68,632.597 2137.77,626.336 2139.86,620.046 2141.95,613.727 2144.04,607.379 \n",
       "  2146.12,601.002 2148.21,594.596 2150.3,588.161 2152.39,581.697 2154.47,575.204 2156.56,568.681 2158.65,562.129 2160.74,555.548 2162.83,548.938 2164.91,542.297 \n",
       "  2167,535.628 2169.09,528.929 2171.18,522.2 2173.26,515.441 2175.35,508.653 2177.44,501.835 2179.53,494.987 2181.62,488.11 2183.7,481.202 2185.79,474.265 \n",
       "  2187.88,467.297 2189.97,460.299 2192.06,453.271 2194.14,446.213 2196.23,439.125 2198.32,432.007 2200.41,424.858 2202.49,417.678 2204.58,410.469 2206.67,403.228 \n",
       "  2208.76,395.958 2210.85,388.656 2212.93,381.324 2215.02,373.961 2217.11,366.568 2219.2,359.143 2221.28,351.688 2223.37,344.202 2225.46,336.685 2227.55,329.137 \n",
       "  2229.64,321.557 2231.72,313.947 2233.81,306.305 2235.9,298.633 2237.99,290.929 2240.08,283.193 2242.16,275.426 2244.25,267.628 2246.34,259.798 2248.43,251.937 \n",
       "  2250.51,244.044 2252.6,236.12 2254.69,228.163 2256.78,220.175 2258.87,212.155 2260.95,204.104 2263.04,196.02 2265.13,187.905 2267.22,179.757 2269.31,171.577 \n",
       "  2271.39,163.366 2273.48,155.122 2275.57,146.845 2277.66,138.537 2279.74,130.196 2281.83,121.823 2283.92,113.417 2286.01,104.979 2288.1,96.5086 2290.18,88.0053 \n",
       "  \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#000000; fill-opacity:1\" points=\"\n",
       "  271.343,904.245 271.343,944.245 311.343,944.245 311.343,904.245 271.343,904.245 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#c271d2; fill-opacity:1\" points=\"\n",
       "  275.343,908.245 275.343,940.245 307.343,940.245 307.343,908.245 275.343,908.245 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#000000; fill-opacity:1\" points=\"\n",
       "  879.686,1074.2 879.686,1114.2 919.686,1114.2 919.686,1074.2 879.686,1074.2 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#c271d2; fill-opacity:1\" points=\"\n",
       "  883.686,1078.2 883.686,1110.2 915.686,1110.2 915.686,1078.2 883.686,1078.2 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#000000; fill-opacity:1\" points=\"\n",
       "  1401.12,1414.1 1401.12,1454.1 1441.12,1454.1 1441.12,1414.1 1401.12,1414.1 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#c271d2; fill-opacity:1\" points=\"\n",
       "  1405.12,1418.1 1405.12,1450.1 1437.12,1450.1 1437.12,1418.1 1405.12,1418.1 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#000000; fill-opacity:1\" points=\"\n",
       "  1922.56,1074.2 1922.56,1114.2 1962.56,1114.2 1962.56,1074.2 1922.56,1074.2 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9302)\" style=\"fill:#c271d2; fill-opacity:1\" points=\"\n",
       "  1926.56,1078.2 1926.56,1110.2 1958.56,1110.2 1958.56,1078.2 1926.56,1078.2 \n",
       "  \"/>\n",
       "<path clip-path=\"url(#clip9300)\" d=\"\n",
       "M1989.93 433.164 L2280.76 433.164 L2280.76 130.764 L1989.93 130.764  Z\n",
       "  \" fill=\"#ffffff\" fill-rule=\"evenodd\" fill-opacity=\"1\"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  1989.93,433.164 2280.76,433.164 2280.76,130.764 1989.93,130.764 1989.93,433.164 \n",
       "  \"/>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#009af9; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  2013.93,191.244 2157.93,191.244 \n",
       "  \"/>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2181.93, 208.744)\" x=\"2181.93\" y=\"208.744\">y1</text>\n",
       "</g>\n",
       "<circle clip-path=\"url(#clip9300)\" style=\"fill:#000000; stroke:none; fill-opacity:1\" cx=\"2097.93\" cy=\"251.724\" r=\"25\"/>\n",
       "<circle clip-path=\"url(#clip9300)\" style=\"fill:#e26f46; stroke:none; fill-opacity:1\" cx=\"2097.93\" cy=\"251.724\" r=\"21\"/>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2181.93, 269.224)\" x=\"2181.93\" y=\"269.224\">y2</text>\n",
       "</g>\n",
       "<polyline clip-path=\"url(#clip9300)\" style=\"stroke:#3da44d; stroke-width:4; stroke-opacity:1; fill:none\" points=\"\n",
       "  2013.93,312.204 2157.93,312.204 \n",
       "  \"/>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2181.93, 329.704)\" x=\"2181.93\" y=\"329.704\">y3</text>\n",
       "</g>\n",
       "<polygon clip-path=\"url(#clip9300)\" style=\"fill:#000000; fill-opacity:1\" points=\"\n",
       "  2069.93,344.684 2069.93,400.684 2125.93,400.684 2125.93,344.684 2069.93,344.684 \n",
       "  \"/>\n",
       "<polygon clip-path=\"url(#clip9300)\" style=\"fill:#c271d2; fill-opacity:1\" points=\"\n",
       "  2073.93,348.684 2073.93,396.684 2121.93,396.684 2121.93,348.684 2073.93,348.684 \n",
       "  \"/>\n",
       "<g clip-path=\"url(#clip9300)\">\n",
       "<text style=\"fill:#000000; fill-opacity:1; font-family:Arial,Helvetica Neue,Helvetica,sans-serif; font-size:48px; text-anchor:start;\" transform=\"rotate(0, 2181.93, 390.184)\" x=\"2181.93\" y=\"390.184\">y4</text>\n",
       "</g>\n",
       "</svg>\n"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "using Plots\n",
    "ts = linspace(-1.2, 1.2, 1000);\n",
    "p1 = c1[1] .+ c1[2]*ts + c1[3]*ts.^2 + c1[4]*ts.^3;\n",
    "plot(ts, p1)\n",
    "scatter!(t, b1)\n",
    "p2 = c2[1] .+ c2[2]*ts + c2[3]*ts.^2 + c2[4]*ts.^3;\n",
    "plot!(ts, p2)\n",
    "scatter!(t, b2, marker = :square)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**Figure 11.1** Cubic interpolants through two sets of points, shown as circles\n",
    "and squares."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 11.5 Pseudo-inverse\n",
    "In Julia, the pseudo-inverse of a matrix `A` is obtained with `pinv(A)`. We compute the pseudo-inverse for the example on page [216](https://web.stanford.edu/~boyd/vmls/vmls.pdf#section*.270) of VMLS using the `pinv` function, and via the formula $A† = R^{−1}Q^{T}$ , where $A = QR$ is the $QR$ factorization of $A$. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2×3 Array{Float64,2}:\n",
       " -1.22222   -1.11111    1.77778\n",
       "  0.777778   0.888889  -1.22222"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "A = [-3 -4; 4 6; 1 1]\n",
    "pinv(A)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3×2 Array{Float64,2}:\n",
       " -0.588348  -0.457604\n",
       "  0.784465  -0.522976\n",
       "  0.196116   0.719092"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "Q, R = qr(A);\n",
    "Q = Matrix(Q)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2×2 Array{Float64,2}:\n",
       " 5.09902   7.2563  \n",
       " 0.0      -0.588348"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "R"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2×3 Array{Float64,2}:\n",
       " -1.22222   -1.11111    1.77778\n",
       "  0.777778   0.888889  -1.22222"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "R \\ Q' # pseudo-inverse from QR factors"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Julia 1.1.1",
   "language": "julia",
   "name": "julia-1.1"
  },
  "language_info": {
   "file_extension": ".jl",
   "mimetype": "application/julia",
   "name": "julia",
   "version": "1.1.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
